/* ==================== 全局美化 ==================== */
body {
  background: linear-gradient(
    135deg,
    #f8f9fa 0%,
    #e9ecef 100%
  ); /* 添加渐变背景 */
  color: #495057; /* 更易读的文本颜色 */
}

/* ==================== 基础布局 ==================== */
.container {
  display: flex;
  flex-direction: column;
}

/* ==================== 播放器容器 ==================== */
.player-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12); /* 添加柔和阴影 */
  overflow: hidden;
  transition: transform 0.3s ease;
}

.player-container:hover {
  transform: translateY(-2px); /* 悬停微动效 */
}

/* ==================== 视频播放器 ==================== */
.video-js {
  border-radius: 12px 12px 0 0; /* 匹配容器圆角 */
  background: #000; /* 视频加载前背景 */
}

.vjs-control-bar {
  background: rgba(33, 150, 243, 0.9) !important; /* 半透明控制栏 */
  backdrop-filter: blur(4px); /* 毛玻璃效果 */
  border-radius: 0 0 8px 8px;
}

.vjs-play-progress {
  background: #ff6b6b; /* 进度条颜色 */
}

/* ==================== 播放列表 ==================== */
.playlist-container {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.playlist-container h3 {
  font-size: 1.2rem;
  color: #2d3436;
  padding: 16px 20px;
  margin: 0;
  border-bottom: 2px solid #f1f3f5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.playlist-container h3::before {
  content: "▶";
  color: #2196f3;
  font-size: 0.9em;
}

.playlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 0 0 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  cursor: pointer;
}

.playlist-item:hover {
  transform: translateX(8px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.95),
    rgba(245, 248, 250, 0.95)
  );
}

.playlist-item.active {
  background: #2196f3;
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
}

/* 序号样式 */
.playlist-number {
  flex: 0 0 30px;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: #868e96;
}

.playlist-item.active .playlist-number {
  color: rgba(255, 255, 255, 0.8);
}

/* 标题样式 */
.playlist-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* 时长样式 */
.playlist-duration {
  flex: 0 0 60px;
  text-align: right;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-size: 0.9em;
  color: #868e96;
  padding-left: 8px;
}

.playlist-item.active .playlist-duration {
  color: rgba(255, 255, 255, 0.8);
}

/* ==================== 滚动条美化 ==================== */
.playlist::-webkit-scrollbar {
  width: 6px;
}

.playlist::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 4px;
}

.playlist::-webkit-scrollbar-thumb {
  background: rgba(33, 150, 243, 0.4);
  border-radius: 4px;
}

.playlist::-webkit-scrollbar-thumb:hover {
  background: #2196f3;
}

/* ==================== 加载状态 ==================== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: #868e96;
}

.loading::after {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  border-top-color: #2196f3;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error {
  background: #fff5f5;
  border: 1px solid #ffcccc;
  color: #ff6b6b;
  padding: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px;
}

.error::before {
  content: "⚠️";
  font-size: 1.2em;
}

/* ==================== 横屏优化 ==================== */
@media (orientation: landscape) {
  .player-container {
    border-radius: 16px;
  }

  .playlist-item {
    margin: 0 8px 6px 8px;
    padding: 12px 14px;
  }

  .playlist-container h3 {
    font-size: 1.1rem;
    padding: 14px 18px;
  }
}
